<?php

/**
* @version $Id: controller.php 18 2009-12-07 11:22:56Z truongnhan0311 $
* @author truongnhan0311
* @package    wrd component
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<link rel="stylesheet" href="css/myAccount.css" type="text/css" />
<?php
    $profile = $this->profile;
    $points = $this->points;
    echo '<p class="summary">Hello ,this is your point. </p><br />';
	if(count($points['models'])):
?>
<table border="0" bgcolor="999999" cellspacing="1" style="margin: 7px; border-collapse: separate; border-spacing: 1px;" width="97%" cellpadding="3">
    <thead>
        <tr style="background: #f8f8f8;">
            <th><strong>Date</strong></th>
            <th><strong>Activity</strong></th>
            <th><strong>Description</strong></th>
            
            <th><strong>Spending</strong></th>
            <th><strong>Points Debit</strong></th>
            <th><strong>Points Debit</strong></th>
        </tr>
    </thead>
    <tbody>
        <?php 
            $des = array(
                'import user' => 'F & B',
                'Redemption' => 'Redemption',
                'transaction' => 'F &amp; B',
                'register' => 'Register'
            );
		 
            foreach($points['models'] as  $key => $item):
             
                    if($item->des == 'Redemption' || $item->des == 'register'):
                        $item->total = '';
                        if($item->des == 'register'):
                            $item->outlet = '';
                        endif;
                    endif;
                    echo '
                        <tr class="'.($key%2 == 0 ? 'even' : 'odd').'" style="background: #ffffff;">
                            <td>'.$item->created_date.'</td>
                            <td>'.$des[$item->des].'</td>
                            <td>'.$item->outlet.'</td>
                            
                            <td>'.$item->total.'</td>
                            <td>'.($item->point < 0 ? $item->point : '').'</td>
                            <td>'.($item->point > 0 ? $item->point : '').'</td>
                        </tr>
                    ';     
              
            endforeach;
			
        ?>
    </tbody>
</table>
<?php 
    endif; // Check points['models']
?><br />
<div id="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
